#ifndef MYTHREAD_H
#define MYTHREAD_H
#include <pthreads/pthread.h>

class MyThread
{
public:
    MyThread();
    virtual ~MyThread();
    void Lock();
    void Unlock();

protected:
    void Start();
    virtual void Run() = 0;
    void Join();

private:
    bool mRunning;
    pthread_t mThreadID;
    pthread_attr_t mThreadAttribute;
    pthread_mutex_t mMutex;

    MyThread(const MyThread&);
    const MyThread& operator=(const MyThread&);

    static void* StartThread(void* pVoid);
};
#endif // MYTHREAD_H
